package com.sunny.ynhz.adapter;

import android.content.Context;
import android.view.View;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sunny.ynhz.R;
import com.sunny.ynhz.bean.PartrolRouteBean;
import com.sunny.ynhz.bean.SeasureAppBean;

import java.util.List;

/**
 * Created by huhuan123 on 2018/1/8.
 */

public class PatrolRouteAdapter extends BaseMultiItemQuickAdapter<PartrolRouteBean.DataBean.ChildrenBean, BaseViewHolder> {
    Context context;
    List<SeasureAppBean.DataBean.ContentBean> newsData;
    Context mContext;

    public PatrolRouteAdapter(List<PartrolRouteBean.DataBean.ChildrenBean> data) {
        super(data);
        addItemType(1, R.layout.item_problem_route);
    }

    @Override
    protected void convert(BaseViewHolder helper, PartrolRouteBean.DataBean.ChildrenBean item) {
        String strTime = item.getStrTime();
        String endTime = item.getEndTime();
        String distance = item.getDistance();
        String name = item.getName();
        View tv_partol_time = helper.getView(R.id.tv_partol_time);
        helper.setText(R.id.tv_user_name, name).setText(R.id.tv_partol_distance, distance).setText(R.id.tv_partol_time, item.getTime());
        helper.setText(R.id.tv_start_time, strTime).setText(R.id.tv_end_time, endTime);
        if (item.isShow()) tv_partol_time.setVisibility(View.VISIBLE);
        else tv_partol_time.setVisibility(View.GONE);
    }
}
